<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
    <div id="app"></div>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>
    <script type="text/babel">
        class MyComponent extends React.Component{
            state={a:1,b:2}
            render(){
                return <h1 onClick={this.getNum}>Hello React!</h1>
            }
            getNum=()=>{
                console.log(this)
                console.log(this.state.a)
            }
        }

        ReactDOM.render(<MyComponent/>,document.getElementById('app'))
    </script>
</body>
</html>